<template>
  <BasicDrawer :destroy-on-close="true" width="60%" title="字典项管理" @register="registerDrawer">
    <DictItemIndex :dict-id="currentRecord?.id" />
  </BasicDrawer>
</template>
<script setup lang="ts">
  import { BasicDrawer, useDrawer } from '@/components/Drawer';
  import DictItemIndex from '../dictItem/index.vue';
  import { ref } from 'vue';

  const currentRecord = ref();
  const tableRef = ref();
  const [registerDrawer, { openDrawer }] = useDrawer();
  defineExpose({
    show(record, tableAction) {
      currentRecord.value = record;
      tableRef.value = tableAction;
      openDrawer();
    },
  });
</script>
